<%@page import="com.kaishengit.entity.Prod"%>
<%@page import="com.kaishengit.dao.ProdDao"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	
	String id = request.getParameter("id");

	ProdDao dao = new ProdDao();
	Prod prod = null;
	try {
		prod = dao.findById(Integer.parseInt(id));
	} catch(NumberFormatException e) {
		response.sendRedirect("home.jsp");
		return;
	}
	
	if(prod != null) {
		request.setAttribute("prod", prod);
		request.getRequestDispatcher("show.jsp").forward(request, response);
	} else {
		response.sendRedirect("home.jsp");
	}

%>
